/*
 * ID Class for Orderline class, orderline got a composit primary key made from
 * productId in Product and basketId in ShoppingBasket.
 * @Author: zim & ohm
 */

package webshop.data;
import java.io.Serializable;

public class OrderlineId implements Serializable {
   
    // Declaring Variables.
    private long shoppingBasketId;
    private long productId;

    // Constructors.
    public OrderlineId() {
    }

    public OrderlineId(long shoppingBasketId, long productId) {
      this.shoppingBasketId = shoppingBasketId;
      this.productId = productId;
    }

    // Methods.
    public boolean equals(Object o) {
        return ((o instanceof OrderlineId) &&
                shoppingBasketId == ((OrderlineId) o).getShoppingBasketId()) &&
                productId == ((OrderlineId)o).getProductId();
    }

    // Setters and Getters.
    public long getShoppingBasketId() {
        return shoppingBasketId;
    }
    
    public long getProductId() {
        return productId;
    }
}